def order(run_order):
    """标记测试方法执行顺序的装饰器"""
    def decorator(test_method):
        test_method.run_order = run_order
        return test_method
    return decorator

def data_provider(data_func):
    """数据驱动测试装饰器"""
    def decorator(test_func):
        def wrapper(self, *args, **kwargs):
            for data in data_func():
                try:
                    # 将数据作为参数传递给测试方法
                    test_func(self, *args, **data, **kwargs)
                except AssertionError as e:
                    # 添加数据上下文信息
                    error_msg = f"测试数据: {data}\n错误信息: {str(e)}"
                    raise AssertionError(error_msg) from e
        return wrapper
    return decorator    